<html>
<head>
    <script src="cross-frame-access.js"></script>
    <script>
        receiver = function(e)
        {
            if (e.data == "deletingValuesComplete")
                setCheck();
        }
        addEventListener('message', receiver, false);

        window.onload = function()
        {
            window.existingProperty = "test value";
            window[1] = "test value";
            window.history.existingProperty = "test value";
            window.history[1] = "test value";
            window.location.existingProperty = "test value";
            window.location[1] = "test value";

            window.parent.postMessage("setValuesComplete", "*");
        }

        setCheck = function()
        {
            log("\n----- tests for deleting the properties of window, window.history, and window.location cross-domain -----\n");

            shouldBe("window.existingProperty", "'test value'");
            shouldBe("window[1]", "undefined");
            shouldBe("window.history.existingProperty", "'test value'");
            shouldBe("window.history[1]", "'test value'");
            shouldBe("window.location.existingProperty", "'test value'");
            shouldBe("window.location[1]", "'test value'");

            if (window.testRunner)
                testRunner.notifyDone();
        }
    </script>
</head>
<body>
    <pre id="console"></pre>
</body>
</html>
